<?php
if($_POST['mode'] == 1)
{
        if($_POST['auto_air'] == "0")
        {
				$cmd = "/home/pi/modules/ITemp.sh auto_air ".$_POST['auto_air'];
                system($cmd);
				 echo $cmd;
                echo "<div class=\"alert alert-success\">设置手动模式成功</div>";
        }
        else
        {
				$cmd = "/home/pi/modules/ITemp.sh auto_air ".$_POST['auto_air'];
                system($cmd);
				 echo $cmd;
                echo "<div class=\"alert alert-success\">设置自动模式成功</div>";
        }
}
/*
if($_POST['mode'] == 2)
{		
		if($_POST['AIR_STATUS'] == "0")
		{
			 
			 $cmd = "irsend SEND_ONCE AIR ".$CMD['KEY_EXIT'];
             system($cmd);
			 echo $cmd;
             echo "<div class=\"alert alert-success\">空调关闭成功</div>";
		}
		else
		{
			$cmd = "irsend SEND_ONCE AIR ".$CMD['KEY_26'];
             system($cmd);
			 echo $cmd;
             echo "<div class=\"alert alert-success\">空调开启成功</div>";
		}
}
*/
?>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="assets/css/style.css"/>
<link rel="stylesheet" href="assets/css/font-awesome.min.css" />
<script src="assets/js/jquery.min.js"></script>        
<script src="assets/js/bootstrap.min.js"></script>
<title>系统设置</title>
<script type="text/javascript">	
	jQuery(document).ready(function(){ 												
	//时间设置
	function currentTime(){ 
		var d=new Date(),str=''; 
		str+=d.getFullYear()+'年'; 
		str+=d.getMonth() + 1+'月'; 
		str+=d.getDate()+'日'; 
		str+=d.getHours()+'时'; 
		str+=d.getMinutes()+'分'; 
		str+= d.getSeconds()+'秒'; 
		return str; 
		} 
	document.getElementById("time").innerHTML=currentTime();
	}
</script>
</head>

<body>
<div class="page-content clearfix">
 <div class="alert alert-block alert-success">
  <button type="button" class="close" data-dismiss="alert"><i class="icon-remove"></i></button>
  <i class="icon-ok green"></i>欢迎使用<strong class="green">后台管理系统<small>(v1.2)</small></strong>,你本次登陆时间为<strong><?php echo date('Y-m-d H:i:s'); ?> </strong></div>
 <div class="state-overview clearfix">
                  <div class="col-lg-6 col-sm-6">
                      <section class="panel">
                      <a href="#" title="温度">
                          <div class="symbol terques">
                             <i class="icon-user"></i>
                          </div>
                          <div class="value">
                              <h1><?php require ("../ITemp.php"); echo $SENSOR['env_temp'];?>℃</h1>
                              <p>当前室内温度</p>
                          </div>
                          </a>
                      </section>
                  </div>
                  <div class="col-lg-6 col-sm-6">
                      <section class="panel">
                          <div class="symbol red">
                              <i class="icon-tags"></i>
                          </div>
                          <div class="value">
                              <h1><?php echo $SENSOR['env_rh'];?>℉</h1>
                              <p>当前室内湿度</p>
                          </div>
                      </section>
                  </div>

              </div>
             <!--实时交易记录-->
             <div class="clearfix">
           <!--   <div class="t_Record">
               <div id="main" style="height:300px; overflow:hidden; width:100%; overflow:auto" ></div>     
              </div> -->

<div class="col-sm-6">
         <div class="news_style">
          <div class="title_name">模式选择</div>
 
		<form action="home.php" method="post" enctype="multipart/form-data">
		<input type="hidden" name="mode" value="1">
		
		<?php
		require ("../ITemp.php");
		if( $SENSOR['auto_air']== "1")
		{
		 echo "</br>";
		 echo "<h4 style=\"display: inline-block\">切换为：</h4>";
                echo "<input type='hidden' name='auto_air' value='0'>";
                echo "<button type='submit' class=\"btn btn-primary\">手动模式</button>";
				echo "当前为自动模式";
        }
        else
        {        echo "切换为：";
                echo "<input type='hidden' name='auto_air' value='1'>";
                echo "<button type='submit' class=\"btn btn-danger\">自动模式</button>";
				echo "当前为手动模式";
				 echo "</br>";
				 echo "<h4>······当前模式即使达到温度警戒线，空调也不会自动开启！······</h4>";
				 echo "</br>";
	    
		
        }
		echo "</br>";
		?>
		</form>
		 
   </div> 
</div>
<div class="col-sm-6">		 
         <div class="news_style">
          <div class="title_name">最新消息</div>
          <ul class="list">
           <li><i class="icon-bell red"></i><a href="#">后台系统找那个是开通了到目前为止还行没问题。</a></li>
           <li><i class="icon-bell red"></i><a href="#">6月共处理订单3451比，作废为...</a></li>
           <li><i class="icon-bell red"></i><a href="#">后台系统找那个是开通了到目前为止还行没问题。</a></li>
           <li><i class="icon-bell red"></i><a href="#">后台系统找那个是开通了到目前为止还行没问题。</a></li>
           <li><i class="icon-bell red"></i><a href="#">后台系统找那个是开通了到目前为止还行没问题。</a></li>
          </ul>
         </div> </div></div>
         </div>
		   
</body>
</html>